package com.spukmk3me.scene;

import com.spukmk3me.video.VideoAPI;

/**
 *  \details
 *  Root node always exists and cannot be dropped or detached.
 */
public interface Scene
{
    public Node createNode();
    public Node createNode( String name );
    
    public Node getRoot();
    public Node getNode( String name );
    
    public void insertNodeAfter( Node node, Node predecessor );
    public void attachNode( Node parent, Node child );
    public void detachNode( Node node );
    public Node detachNode( String name );
    
    public void dropNode( Node node );
    public Node dropNode( String name );
    public void dropChildren( Node node );
    public Node dropChildren( String name );
    
    public VideoAPI getVideoAPI();
    
    /**
     *  Render all scene and apply animator's animation.
     *  \details Nodes are rendered in parent-first order. Animator's works
     *  are applied after the node is rendered.\n
     *  Override this implementation if you find it not sufficient.
     *  @param deltaTime Time in seconds (16.16).
     */
    public void render( int deltaTime );
    
    /**
     *  Render all scene and apply animator's animation.
     *  \details Nodes are rendered in parent-first order. Animator's works
     *  are applied after the node is rendered.\n
     *  Override this implementation if you find it not sufficient.
     *  @param deltaTime Time in seconds (16.16).
     */
    public void render( Node node, int deltaTime );
    
    public static final String ROOT = "root";
}
